package com.ymatou.userservice.testcase;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.ymatou.auth.parameter.SecurityQuestion;
import com.ymatou.auth.service.LoginAuthCall;
import com.ymatou.userservice.parameter.QueryBuyerLevelRequestDtoBean;
import com.ymatou.userservice.service.QueryBuyerLevelRequestDtoCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.AuthCallService;
import com.ymttest.business.service.UserCallService;
import com.ymttest.database.sqlwapper.UserLogoWapper;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
/**
*批量查询用户
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_QueryBuyerLevelRequestDto{
	private static QueryBuyerLevelRequestDtoBean QueryBuyerLevelRequestDtoBean;
	private static QueryBuyerLevelRequestDtoCall QueryBuyerLevelRequestDtoCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("批量查询用户");
	}

	@Before
	public void caseUp() {
		QueryBuyerLevelRequestDtoBean=new QueryBuyerLevelRequestDtoBean();
		QueryBuyerLevelRequestDtoCall=new QueryBuyerLevelRequestDtoCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(QueryBuyerLevelRequestDtoCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryBuyerLevelRequestDto_001() {
		Logger.start(true,"查询用户等级");
		try {
			Map m=UserCallService.registerUser(null, TestDataManager.getPhoneNum(), TestDataManager.getRandomIp());
			QueryBuyerLevelRequestDtoBean.setIn("1");
			QueryBuyerLevelRequestDtoBean.setIsGetNextLevel("0");
			QueryBuyerLevelRequestDtoBean.setQueryKey(m.get("userId").toString());
			QueryBuyerLevelRequestDtoBean.setQueryType("1");
			QueryBuyerLevelRequestDtoCall.setData(QueryBuyerLevelRequestDtoBean);
			QueryBuyerLevelRequestDtoCall.callService();			
			Logger.verifyEquals("200", QueryBuyerLevelRequestDtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true", QueryBuyerLevelRequestDtoCall.getString("Success"), "验证Success");
			JsonObject js = QueryBuyerLevelRequestDtoCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}